/* 
 * File:   JRepositoryFile.cpp
 * Author: johnneyshi
 * 
 * Created on 2013年1月6日, 上午10:11
 */

#include "JRepositoryFile.h"
#include "JWorkingCopies.h"

JRepositoryFile::JRepositoryFile() : file(JWorkingCopiesBaseFile())//////////////////////////////////
{
}

JRepositoryFile::JRepositoryFile(const JRepositoryFile& orig) {
}

JRepositoryFile::~JRepositoryFile() 
{
}

int JRepositoryFile::Serialize(std::iostream& _strea,int& allSize)
{
    int classSize = 0,selfSize = 0;
    JSerialize::PutInt(_strea,classSize,selfSize);
    file.Serialize(_strea,classSize);
    JSerialize::Serialize(_strea,this->realPosition,classSize);
    JSerialize::Serialize(_strea,this->realFileName,classSize);
    selfSize += classSize;
    JSerialize::Verify(_strea,classSize,-1*selfSize);
    allSize += selfSize;
    return selfSize;
}

void JRepositoryFile::ReSerialize(std::iostream& _strea)
{
    int classSize = JSerialize::GetInt(_strea,sizeof(int));
    file.ReSerialize(_strea);
    this->realPosition = JSerialize::ReSerializeString(_strea);
    this->realFileName = JSerialize::ReSerializeString(_strea);
}